﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Diagnostics;

namespace Agent.Messaging
{
  /// <summary>
  /// Simple wrapper used internall by the MessageSender so it can flag itself to stop the main loop
  /// </summary>
  internal class MessageWrapper
  {
    /// <summary>
    /// Creates a new instance
    /// </summary>
    /// <param name="type">The type of message (system or user)</param>
    /// <param name="message">The actual message, if this is a user message</param>
    internal MessageWrapper(MessageType type, string message)
    {
      MessageType = type;
      UserMessage = message;
    }

    /// <summary>
    /// Creates a new instance
    /// </summary>
    /// <param name="type">The type of message; mustn't be a user message</param>
    internal MessageWrapper(MessageType type) : this(type, null)
    {
      Debug.Assert(type != MessageType.UserMessage);
    }
    
    /// <summary>
    /// The type of the message
    /// </summary>
    internal MessageType MessageType { get; set; }

    /// <summary>
    /// The actual content of the message, if it was a user message
    /// </summary>
    internal string UserMessage { get; set; }
  }
}
